package com.study.java8.lamdba;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class StramFilterPerDicate {

    public static void main(String[] args) {

        Employee employee=new Employee("1",12,"M","chen","ying");
        Employee employee1=new Employee("2",13,"M","chen","ying");
        Employee employee2=new Employee("3",12,"M","chen","ying");
        Employee employee3=new Employee("4",14,"M","chen","ying");
        Employee employee4=new Employee("5",12,"M","chen","ying");
        Employee employee5=new Employee("6",15,"F","chen","ying");


        List<Employee> employeeList= Arrays.asList(employee,employee1,employee2,employee3,employee4,employee5);

        List<Employee> employeeStream = employeeList.stream()
                .filter(e -> e.getGender().equals("F") && e.getAge()>14)
                .collect(Collectors.toList());


        System.out.println(employeeStream);

    }

}
